<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人信息练习</title>
    <style>
        body{
            background-color: #e8e8e8;
            font:32px cursive;
        }
        table{
            border: 1px solid black;
            border-radius: 3px;
        }
        td,th{
            border: 1px solid blue;
            border-radius: 3px;
        }
        input[type="text"],input[type="password"]{
            width: 200px;
            height: 35px;
            border-radius: 5px;
            font-size: 25px;
            background-color: #e8e8e8;
        }
        input[type="button"]{
            width: 120px;
            height: 35px;
            text-align: center;
            font-size: 20px;
            border-radius: 3px;
        }
    </style>
</head>
<body>
<div>
<table>
    <caption>个人信息</caption>
    <tr>
        <td>照片</td>
        <td><img :src="person.imgUrl" alt="" width="100px"></td>
    </tr>
    <tr>
        <td>名字:</td>
        <td>{{person.name}}</td>
    </tr>
    <tr>
        <td>年龄:</td>
        <td>{{person.age}}</td>
    </tr>
    <tr>
        <td>好友:</td>
        <td><ul><li v-for="name in person.friend">
            {{name}}
        </li></ul></td>
    </tr>
</table>
    <input type="button" value="请求数据" @click="f()">
</div>

<script src="../js/vue.js"></script>
<script>
    let v=new Vue({
        el:"div",
        data:{
            person:{name:"xxx",age:"xxx",imgUrl:"meimei.jpg",
                friend:["xxx","xxx","xxx"]}
        },
        methods:{
            f(){
                let student={name:"申浩",age:25,imgUrl:"gege.jpg",
                    friend:["王氪金","刘传奇","成恒","王老爷","李白领"]};
                v.person=student;
            }
        }
    })
</script>
</body>
</html>